import java.util.Random;
import java.util.Scanner;

/**
 * @author zby
 */
public class GuessNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        while (true) {
            for (int i = 0; i < 7; i++) {
                int csz = random.nextInt(100) + 1;
                System.out.println("输入猜到的数字");
                int number = scanner.nextInt();
                if (csz < number) {
                    System.out.println("你的猜数大了");
                } else if (csz > number) {
                    System.out.println("你猜的数猜小了");
                } else {
                    System.out.println("你猜的数猜对了");
                    break;
                }
            }
            System.out.println("如果你想继续游戏请输入1，退出游戏输入其他数");
            int input= scanner.nextInt();
            if (input!=1){
                break;
            }
        }
    }
}
